package arthur;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class TestQuick {

	//private quickSort2 quicksortImpl;
	private quickSortRandomized q1;
	private int[] array1 = { 14, 28, 1, 6, 9, 4, 18, 7, 3, 21, 2, 17, 25, 15,
			19, 8, 16, 38, 0, 29 };
	private int[] array2 = { 38, 29, 17, 6, 9, 4, 25, 7, 3, 21, 2, 1, 14, 18,
			15, 19, 8, 16, 28, 0 };
	private int[] arrayOrdenado = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 14, 15, 16, 17,
			18, 19, 21, 25, 28, 29, 38 };

	@Before
	public void setUp() throws Exception {
		// instancie sua implementacao aqui
		q1 = new quickSortRandomized();
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void quickSortMedian3() {
		Assert.assertArrayEquals(arrayOrdenado, q1.quickSort(array1, 0, array1.length - 1));
		Assert.assertArrayEquals(arrayOrdenado, q1.quickSort(array2, 0, array1.length - 1));
	}

}